package com.chinacoal.hr.levelapi.client;

import com.chinacoal.hr.levelapi.client.fallback.LoginClientFallback;
import com.chinacoal.hr.levelapi.client.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;


/**
 * Created by jinyabin on 2020/10/29.
 */
@Api(tags = {"登录"})
@FeignClient(name = "login",configuration = FeignAutoConfiguration.class,fallback = LoginClientFallback.class)
public interface LoginClient {



    @RequestMapping("/user/login")
    @ResponseBody
    public Map login() ;



    @RequestMapping("/user/info")
    @ResponseBody
    public Map userinfo() ;



    /**
     * 获得登陆的用户
     *
     * @return : Result
     * @author : YunTao.Li
     * @date : 2019/12/11 2019/12/11
     */
    @ResponseBody
    @RequestMapping("/login/user")
    @ApiOperation(value = "获得登陆的用户")
    public Result user(@RequestHeader HttpHeaders headers);


}
